package tech.edwardvan.springsecuritydemo.common;

/**
 * 响应常量
 *
 * @author EdwardVan
 */
public enum ResponseCode {
    /**
     * 成功
     */
    SUCCESS(200, "请求成功"),
    /**
     * 身份验证失败
     */
    UNAUTHORIZED(401, "身份验证失败"),
    /**
     * 权限验证失败
     */
    FORBIDDEN(403, "权限验证失败"),
    /**
     * 失败
     */
    ERROR(500, "请求失败");

    private final int code;
    private final String desc;

    ResponseCode(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
